package com.wuye.basic.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wuye.basic.mapper.WyUnitMapper;
import com.wuye.basic.domain.WyUnit;
import com.wuye.basic.service.IWyUnitService;

/**
 * 单元Service业务层处理
 * 
 * @author avalon
 * @date 2024-11-25
 */
@Service
public class WyUnitServiceImpl extends ServiceImpl<WyUnitMapper,WyUnit>
        implements IWyUnitService
{
    @Autowired
    private WyUnitMapper wyUnitMapper;

    /**
     * 查询单元
     * 
     * @param unitId 单元主键
     * @return 单元
     */
    @Override
    public WyUnit selectWyUnitByUnitId(Long unitId)
    {
        return wyUnitMapper.selectWyUnitByUnitId(unitId);
    }

    /**
     * 查询单元列表
     * 
     * @param wyUnit 单元
     * @return 单元
     */
    @Override
    public List<WyUnit> selectWyUnitList(WyUnit wyUnit)
    {
        return wyUnitMapper.selectWyUnitList(wyUnit);
    }

    /**
     * 新增单元
     * 
     * @param wyUnit 单元
     * @return 结果
     */
    @Override
    public int insertWyUnit(WyUnit wyUnit)
    {
        return wyUnitMapper.insertWyUnit(wyUnit);
    }

    /**
     * 修改单元
     * 
     * @param wyUnit 单元
     * @return 结果
     */
    @Override
    public int updateWyUnit(WyUnit wyUnit)
    {
        return wyUnitMapper.updateWyUnit(wyUnit);
    }

    /**
     * 批量删除单元
     * 
     * @param unitIds 需要删除的单元主键
     * @return 结果
     */
    @Override
    public int deleteWyUnitByUnitIds(Long[] unitIds)
    {
        return wyUnitMapper.deleteWyUnitByUnitIds(unitIds);
    }

    /**
     * 删除单元信息
     * 
     * @param unitId 单元主键
     * @return 结果
     */
    @Override
    public int deleteWyUnitByUnitId(Long unitId)
    {
        return wyUnitMapper.deleteWyUnitByUnitId(unitId);
    }
}
